1. Field of the Invention
The present invention relates generally to a technology for obtaining a three-dimensional image from stereo images, and in particular, to a method and device for generating a disparity map from stereo images and a stereo matching method and device therefor.
2. Description of the Related Art
Stereo matching technology is used to obtain a three-dimensional (3D) image from stereo images. Further, the stereo matching technology is used to obtain a 3D image from multiple two-dimensional (2D) images of an object photographed from different positions on the same line. The stereo images are a pair of 2D images of the object photographed from different positions.
In order to generate a 3D image from the 2D images in the conventional art, a z coordinate corresponding to depth information as well as x and y coordinates corresponding to vertical and horizontal position information are required. Disparity information of the stereo images is required to compute the z coordinate. The stereo matching technology is used to obtain the disparity. For example, if the stereo images are left and right images photographed by two left and right cameras, one of the left and right images is set as a reference image while the other image is set as a search image. In this case, a distance between the reference image and the search image with respect to the same point on a space, i.e., a coordinate difference, is referred to as the disparity. The disparity is obtained using the stereo matching technology.
A disparity map expressed by 3D coordinates is generated from pixel depth information using the disparity between the reference image and the search image with respect to all pixels thereof.
An example of stereo matching technology used to compute the disparity between the reference image and the search image in the conventional art will be briefly described herein. First, a predetermined size reference pixel window having the center of a reference pixel of the reference image is set. With respect to the search image, a search pixel window having the same size as the reference pixel window is set centering on search pixels. Among pixels of the reference image, the reference pixel is used to currently search for a correspondence point from the search image. Among pixels of the search image, the search pixel is used to currently determine whether it is mapped to the correspondence point with respect to the reference pixel. The window has a matrix formed by a center pixel and peripheral pixels surrounding it.
Similarity between pixels within a reference pixel window and each search pixel window is computed. A search pixel of a search pixel window having a largest similarity value with respect to the reference pixel window among search pixel windows is defined as a correspondence pixel mapped to the correspondence point. The disparity is computed as a distance between the reference pixel and the correspondence pixel.
In order to compute the similarity between pixels within the reference pixel window and each search pixel window, a method that computes and compares an average value of the pixels within the reference pixel window and an average value of the pixels within each search pixel window is utilized.
A process for computing and comparing an average value of the pixels within the reference pixel window and an average value of the pixels within each search pixel window requires an increased processing time and an increased amount of memory in use is utilized in order to obtain the disparity between the reference image and the search image. Simply, because the average values of all pixel values within the windows are computed and compared, all the pixel values and the average values thereof within the windows should be stored, such that there is an increase in an amount of memory in use and a processing time. Further, because all correspondence pixels should be searched for with respect to all pixels of an image, there is a significant increase in the amount of memory in use and the processing time.
Alternatively, an embedded system adopted in various mobile terminals of small products such as mobile communication terminals has many limitations, i.e., small power supply capacity, low computation rate of a processor, and small memory capacity. In practice, a function requiring a large amount of memory in use and a long processing time is difficult to be adopted in the embedded system.
In the embedded system different from a computer, it difficult to adopt the various functions for obtaining a 3D image from stereo images to exploit the 3D image.